
import Util from '../framework/util';

const state = {
  msg: '默认数据',
  getDefaultOption: function (key) {
    let dos = this.dateOptions[key];
    let dot = key.indexOf(".");
    if (dot > -1) {
      dos = this.dateOptions[key.substring(0, dot)][key.substring(dot + 1)];
    }
    return dos[0];
  },
  getDefaultYear: function (key) {
    let dos = this.getDefaultOption(key);
    if (Util.isArray(dos.value)) {
      return dos.key;
    } else {
      return dos.value;
    }
  },
  getDefaultMonth: function (key) {
    let dos = this.getDefaultOption(key);
    if (Util.isArray(dos.value)) {
      return dos.value[dos.value.length - 1];
    } else {
      return dos.value;
    }
  },
  dateOptions: {
    "timestamp": new Date().getTime()
  },
  resources: [],
  miniApps: [
    {
      appCode: "Framework7",
      appName: "Framework7",
      appLink: "https://framework7.io/kitchen-sink/vue/index.html",
      preloading: true,
      isLogin: true,
      cssText: "",
      listenResourceJs: ``,
      backJS: ``,
      publicKey: ``,
      privateKey: ``
    },
    {
      appCode: "baidu",
      appName: "baidu",
      appLink: "http://192.168.2.191:9900/",
      preloading: true,
      isLogin: true,
      cssText: "",
      listenResourceJs: ``,
      backJS: ``,
      publicKey: ``,
      privateKey: ``
    },
    {
      appCode: "ceshi",
      appName: "ceshi",
      appLink: "http://192.168.2.191:8080/src/modules/base/miniapp.html",
      preloading: true,
      isLogin: true,
      cssText: "",
      listenResourceJs: ``,
      backJS: ``,
      publicKey: ``,
      privateKey: ``
    },
  ],

  modules: []

}
export default state;
